﻿using System;
using System.Windows.Forms;

namespace nToDo
{
    public partial class GotoUI : Form
    {
        public event DateRangeEventHandler onDateChanged;
        public GotoUI(DateTime currentDate)
        {
            InitializeComponent();
            this.gotoDatepick.Value = currentDate;
        }

        private void closeButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            if (this.onDateChanged != null)
            {
                this.onDateChanged(this, new DateRangeEventArgs(this.gotoDatepick.Value, this.gotoDatepick.Value));
                this.Close();
            }
        }
    }
}
